#!/usr/bin/env python
# -*- coding: utf-8 -*-

from distutils.core import setup
import py2exe
import glob
import sys


sys.argv.append("py2exe") #Avoids having to use the command line
sys.argv.append("-q") #silent mode
sys.path.append(".")
setup(
    #Define the executable....
    windows = [
                {
                    "script": "gmail_reader.py",
                    #"icon_resources": [(1, "xxx.ico")],
                    "name": "gmail checker",
                    "version":"1.0",
                    #"company_name":"",
                    "description":"A simple program that uses the atom feed of gmail to check for new mails",
                }
                ],
    data_files = [
                    #("./images", glob.glob("./images/*.*")),  #copy of the images -> into the images folder
                    (".", ["config.ini","mail.png","no_mail.png"]),
                ],
    options = {"py2exe":{"excludes" : ['_gtkagg', '_tkagg', 'bsddb', 'curses', 'email', 'pywin.debugger',
                                    'pywin.debugger.dbgcon', 'pywin.dialogs', 'tcl',
                                    'Tkconstants', 'Tkinter'],
                        "dll_excludes": ['libgdk-win32-2.0-0.dll', 'libgobject-2.0-0.dll', 'tcl84.dll',
                                    'tk84.dll'],
                        #"includes": ["feedparser"],
                        "bundle_files": 1,
                        "compressed": 2,
                        "optimize": 2,
                        #"ascii": 1,
                        }
                },
    zipfile = None,
    )

print "removing build directory..."
import shutil
# Remove the build directory
shutil.rmtree("build", ignore_errors=True)
print "FIN"